<!-- 弹窗功能 -->
<template>
  <div class="usercontain">
    <el-dialog title="提示" :visible.sync="dialogVisible" width="40%">
      <slot name="formuser"></slot>
    </el-dialog>
    <div class="btn-dialog">
      <el-button type="primary" @click="changedia(true), handleTable">
        <slot name="add-dialog">新增</slot>
      </el-button>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  data() {
    return {}
  },
  computed: {
    ...mapState({
      dialogVisible: state => state.tab.dialogVisible
    })
  },
  methods: {
    ...mapMutations(['changedialogVisible', 'handletable']),
    changedia(val) {
      this.changedialogVisible(val)
    },
    handleTable() {
      this.handletable()
    }
  }
}
</script>

<style lang="less" scoped>
::v-deep .el-dialog__headerbtn {
  display: none;
}
</style>
